package com.zc.datastructure.structure.tree;


import com.zc.datastructure.structure.AbstractNodeData;
import com.zc.datastructure.structure.AbstractNode;
import lombok.Data;

/**
 * @author: zhuCan
 * @date: 2019-08-09 09:39
 * @description: 树处理器的, 父接口的 通用实现类
 */
@Data
public abstract class AbstractTree<NODE extends AbstractNode<DATA>, DATA extends AbstractNodeData> implements TreeHandler<NODE, DATA> {

  /**
   * 树的 初始根节点
   */
  protected NODE root;

  @Override
  public boolean isEmpty() {
    return root == null;
  }

  @Override
  public void clear() {
    root = null;
  }

  @Override
  public int depth() {
    return 0;
  }
}
